import { createRouter, createWebHistory } from 'vue-router';

import Main from '../pages/main.vue';
import LoadFile from '../pages/loadFile.vue';
import ShowExcel from '../pages/showExcel.vue';

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',                        // 首页
            redirect: '/main',
        }, {
            path: '/main',
            name: 'Main',
            component: Main,
            children: [
                {
                    path: '/loadFile',
                    name: 'LoadFile',
                    component: LoadFile,
                }, {
                    path: '/showExcel',
                    name: 'ShowExcel',
                    component: ShowExcel,
                    props: true
                }
            ]
        },
    ]
});

export default router;